package springstudy;

import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import springstudy.myrepository.MyFirstRepository;

/**
 * 手动装配自定义注解 {@link springstudy.annotation.FirstLevelRepository}
 */
@ComponentScan(basePackages = "springstudy.myrepository")
public class MyRepositoryApplication {
	public static void main(String[] args) {
		ConfigurableApplicationContext applicationContext = new SpringApplicationBuilder(MyRepositoryApplication.class).web(WebApplicationType.NONE).run(args);
		MyFirstRepository firstRepository = applicationContext.getBean("myFirstRepository", MyFirstRepository.class);
		System.out.println("MyFirstRepository Bean "+firstRepository);
		//关闭上下文
		applicationContext.close();
	}
}
